function Person(name) {
	this.name = name
}


// function myNew() {
// 	var obj = {}
// 	var constructor = Object.prototype.shift.call(arguments)
// 	obj._proto_ = constructor.prototype
// 	var result = constructor.apply(obj, arguments)
// 	return typeof result === 'object' && result !== 'null' ? result : obj
// }

function myNew(fn, args) {
	const obj = {}
	let result = fn.apply(obj, args)
	obj.__proto__ = fn.prototype
	return typeof result === 'object' && result !== 'null' ? result : obj
}

let p = myNew(Person, '阿伟')
// p
